import requests
import re

pages = [1,2,3]
for page in pages:
    url = f"https://yuedu.163.com/book/rank/sell/month/p{page}/s20"
    headers = {
        # "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36"
    }

    r = requests.get(url, headers=headers)
    print("请求状态码：", r.status_code)


    req = re.findall( r'<div class="index.*?">(.*?)</div>.*?<img src="(.*?)" alt="(.*?)".*?<p class="author">(.*?)</p>', r.text, re.S)
    print(req)

